export default {

  // isDebug: true, //测试环境
  isDebug: false, //生产环境

  getHost() {
    if (this.isDebug) {
      return 'http://120.24.89.166:520'; //测试环境
    } else {
      return 'http://119.23.134.227:81'; //生产环境
    }
  },

  /**
   * 消息提示框
   */
  toast(msg = '', time = 1500) {
    var toast = document.createElement('div')
    toast.className = 'common-toast common-toast-show'
    toast.innerHTML = msg
    document.body.appendChild(toast)
    toast.style.display = 'block'
    toast.style.margin = `-${toast.offsetHeight / 2}px 0 0 -${toast.offsetWidth / 2}px`
    var timer = setTimeout(() => {
      toast.className = 'common-toast common-toast-hide'
      clearTimeout(timer)
      var timer2 = setTimeout(() => {
        document.body.removeChild(toast)
        clearTimeout(timer2)
      }, 200)
    }, time)
  },
}
